﻿// -----------------------------------------------------------------------
// <copyright file="Serializer.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace SurfaceInteraction.UI.Surface.Helper
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.IO;

    public class Serializer
    {
        public static byte[] FileToByteArray(string file)
        {
            byte[] retVal = null;

            try
            {
                using (FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read))
                {
                    retVal = new byte[fs.Length];
                    fs.Read(retVal, 0, System.Convert.ToInt32(fs.Length));
                    fs.Close();
                }
            }
            catch
            {
                // log..
                throw;
            }

            return retVal;
        }
    }


}
